/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.mzk.lidovky.articles.articlesData.errors;

/**
 *
 * @author Martin Řehánek (rehan@mzk.cz)
 */
public class ErrorFactory {
    //TODO: bud odstranit a pouzivat jenom konstruktory (to ale budeme mit mensi data ze statistik - jen tridy a pocty
    //nebo udelat takto i statistiky v ArticleBuilder

    public static ArticleError createACError(ACErrorType status, Object[] params) {
        switch (status) {
            case errorParsing:
                return new ACParsingError((String) params[0]);
            case errorDatesNotEqualsNumbers:
                return new DifferentDateAndIssueNumbersError(params);
            case errorDatesNotEqualsPages:
                return new DifferentDateAndPageNumbersError(params);
            case errorDatesNotInAscendingOrder:
                return new DatesNotInAscendingOrderError();
            case errorIssueMissing:
                return new IssueMissingError();
            case errorIssueNumbersNotEqualsDayTimes:
                return new DifferentIssueAndDayTimeNumbersError(params);
            case errorVolumeMissing:
                return new VolumeMissingError();
            case incorrectDateNumberMapping:
                return null; //TODO: promyslet
            default:
                return null;
        }
    }
}
